<template>
    <div id="newsDetailPage">

        <div class="contentDiv">
            <div class="title" v-show="result.title">{{result.title}}</div>
            <div class="time" v-show="result.updateAt">{{result.updateAt}}</div>
            <div class="htmlDiv" v-show="result.content" v-html="result.content"></div>
        </div>

    </div>
</template>

<script>
    import {api_newsDetail} from "@/service/api/home"

    export default {
        name: "NewsDetailPage",
        data(){
            return {
                id:this.$route.query.id,
                result:{}
            }
        },
        created() {
            this.requestData();
        },
        methods:{
            requestData(){

                api_newsDetail(this.id).then((res)=>{
                    this.result = res.data;
                }).catch((error)=>{
                    this.$toast(error.message);
                });

            }
        }
    }
</script>

<style scoped>
#newsDetailPage{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*height: 100%;*/
    background-color: #f5f5f5;
    z-index: 200;
    overflow: auto;
}
    .contentDiv{
        padding: 0 1rem;
    }
    .title{
        margin-top: 1.4rem;
        font-size:1.2rem;
        font-family:PingFangSC-Semibold,PingFangSC;
        font-weight:600;
        color:rgba(18,28,50,1);
        line-height:1.7333333333333334rem;
    }
    .time{
        margin-top: 0.2rem;
        font-size:0.9333333333333333rem;
        font-family:PingFangSC-Regular,PingFangSC;
        font-weight:400;
        color:rgba(122,132,145,1);
        line-height:1.6666666666666667rem;
    }
    .htmlDiv{
        margin: 1.4rem 0;

        /*font-size:1rem;*/
        /*font-family:PingFangSC-Regular,PingFangSC;*/
        /*font-weight:400;*/
        /*color:rgba(122,132,145,1);*/
        /*line-height:1.6666666666666667rem;*/

    }

</style>